/**
 * @file
 * @author  Tsin Smith <tsin.creator@gmail.com>
 *
 */

#ifndef __SCDL_PARSER_INTERNAL_HPP__
#define __SCDL_PARSER_INTERNAL_HPP__

#include <scdl/parser/StringMap.hpp>
#include <scdl/parser/Symbol.hpp>

extern char *curfilename;
void parse_builtin(void);

namespace scdl {
        extern StringMap symbolTable;

        Symbol *getType(const char *type);
        bool checkType(Symbol *current, Symbol *target, bool strict);

        float resolveIdentifier(const char *id);
        Symbol *calculateConstant(char op, Symbol *leftSym, Symbol *rightSym);

        bool makeAssumption(Identifier *id, Symbol *type, Symbol *value);
        bool makeDefinition(Identifier *id, Symbol *type, Symbol *value);
        bool makeBinder(Identifier *id, Symbol *type, const char *binder);
        bool makeInductive(const char *name, Symbol *type, List *ind_list);

        bool resolveParameter(Symbol *binder, Symbol *param);

        bool touchList(const char *name);
        bool addIdentifier(Identifier *id);
        Identifier *getIdentifier(const char *name);

        void position(Symbol *sym);
}

#endif /* __SCDL_PARSER_INTERNAL_HPP__ */
